package com.atguigu.product.mq.listener;

import com.atguigu.common.Msg;
import com.atguigu.order.bean.Order;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RocketMQMessageListener(topic = "${good-sequence-topic}",
        consumerGroup = "${good-sequence-group}",
        consumeMode = ConsumeMode.ORDERLY)
public class GoodSequence implements RocketMQListener<Msg> {
    @Override
    public void onMessage(Msg msg) {
        log.info("收到消息：{}", msg);
    }
}
